package com.vinhvt.effiport.data;

import java.sql.DriverManager;

public class ConnectionManagerDerby extends ConnectionManager {
	private final String DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver";
	public ConnectionManagerDerby(String connectionURL, String username, String password, String scriptResource) {		
		
		try {
			Class.forName(DRIVER_CLASS).newInstance();
			connection = DriverManager.getConnection(connectionURL, username,
					password);
			if (scriptResource != null) {
				executeSQLScript(ConnectionManager.class.getClassLoader().getResourceAsStream(scriptResource));
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

}
